home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group96a.txt / 000008_icon-group-sender _Sat Jan 6 01:50:00 1996.msg < prev    next >
Internet Message Format  |  1996-09-05  |  8KB

  1. Received: by cheltenham.cs.arizona.edu; Mon, 8 Jan 1996 06:10:07 MST
  2. Message-Id: <m0tYTO4-001HkyC@ns1.computek.net>
  3. Date: Sat, 6 Jan 96 01:50 CST
  4. Mime-Version: 1.0
  5. Content-Type: text/plain
  6. Content-Transfer-Encoding: 7bit
  7. From: gep2@computek.net
  8. Subject: Re: How does Icon compare to Perl?
  9. To: icon-group@cs.arizona.edu
  10. X-Mailer: SPRY Mail Version: 04.00.06.17
  11. Errors-To: icon-group-errors@cs.arizona.edu
  12. Status: O
  13.  
  14. >This is the 165423109 posting of Gordon Peterson on this issue. WE KNOW ALL
  15. that Gordon hates Perl and loves Icon. That is perfectly alright! But it starts 
  16. to be really boring. 
  17.  
  18. There is a simple solution to having my messages represent such a high 
  19. percentage of all postings.  Post more actively yourself!!!  As you've noticed, 
  20. the original poster asked how Icon compared to Perl in terms of text handling 
  21. capabilities.  I've not seen a huge number of replies, and I didn't want the 
  22. question to go unanswered!!!
  23.  
  24. >Could Gordon add at least once a serious argument in favour
  25. of his standpoint??!
  26.  
  27. You know, the Icon book (highly recommended) is chock-full of wonderful examples 
  28. of the things that Icon does better than other languages.  And indeed, the Icon 
  29. Program Library contains hundreds of large and small routines and programs that 
  30. are similarly instructive.  So it's not as if anybody who's seriously interested 
  31. doesn't have LOADS of resources to show them copious examples of programs, most 
  32. of which you'd have a much harder time trying to implement in Perl.
  33.  
  34. >I tried to exchange some private letters with Gordon, 
  35.  
  36. I -always- return replies to such letters, but don't recall seeing yours.
  37.  
  38. >but I still don't know the reason of his personal, partisan attitude.
  39.  
  40. I believe I explained it here, more than once.  I had a friend in Paris who was 
  41. very excited about Perl.  I asked him for a choice example of one of his Perl 
  42. applications, to show me why Perl was so wonderful, and I rewrote it (with very 
  43. little effort... and better, more tolerant, more flexible, and more robust) in 
  44. SNOBOL4+ in roughly half the lines, half the bytes, and half the statements of 
  45. source code.
  46.  
  47. What is it about that that you don't understand?
  48.  
  49. >I know why I like Icon. I enjoy the functional 'visage' of the language and
  50. I appreciate in general the generators and co-expressions, as the 
  51. non-determinism is a sine-qua-non methodology for the artificial intelligence.
  52.  
  53. >I like Perl because I learned it before I knew Python and I had to write some 
  54. really lousy CGI scripts. In my opinion the languages ARE comparable. 
  55.  
  56. I don't see how you can claim that.  I believe that just about anything you 
  57. could write in Perl could be easily written in either Icon or SNOBOL4+ (with 
  58. only perhaps a few minor addons to access specific low-level system functions), 
  59. but I don't believe that the converse is true.
  60.  
  61. >Icon is a well structured procedural language, Perl is $horrible, but it has 
  62. been built to deal in a simple manner with regexps. 
  63.  
  64. That's just grand, except that regexps are a "poor man's SNOBOL4-pattern 
  65. substitute", implemented in classical (and still godawful) UNIX/Teletype 
  66. control-characters-do-everything style.  If you like regexps, then you're 
  67. certainly welcome to them... but I consider them a pitiful excuse for 
  68. full-fledged SNOBOL4 patterns.
  69.  
  70. >This is rather a question of style than of the brute power. All this was 
  71. discussed here several times. Perhaps we could write one day a decent 
  72. comparison-FAQ instead of posting slogans.
  73.  
  74. You know, it's really rather like food.  Some people really do not have anything 
  75. like a gourmet palate... for them, absolutely anything that fills the gnawing 
  76. hole in their midsection will do them just fine.  And perhaps, for them, going 
  77. anywhere to eat that's fancier than McDonald's or Sizzler is really just a waste 
  78. of money.  On the other hand, if you are sufficiently discerning to appreciate 
  79. the difference, there really is a world of difference between a Big Mac and a 
  80. really excellent dinner.
  81.  
  82. I got into a really long debate once in an Intelec BBS conference with a moron 
  83. who claimed that "Anything you can do in SNOBOL4+, I can write just as easily 
  84. and quickly in PDS Basic".  (Yeah, RIIIIIIGGHTT!!!)  
  85.  
  86. So I proposed a programming challenge (actually, this was not the first such 
  87. challenge we proposed in that conference, although this was certainly the most 
  88. interesting one).  I uploaded to a commonly-accessible BBS a file I'd collected 
  89. containing something like 20,000 lines from BBS messages.  These lines contained 
  90. normal unformatted message text, sig lines, taglines, price listings, computer 
  91. model numbers and codes, FIDOnet node addresses, occasional E-mail addresses, 
  92. ANSI graphics, header lines, and the like.  The messages originated from authors 
  93. in various countries around the world (but were all written in English or 
  94. French, at least).  The programming assignment was to write a program which 
  95. would extract from this file, and write to an output file, all the complete 
  96. postal addresses and telephone numbers (name, street or PO Box address, county 
  97. or district (in England for example), city, state if any, postal code, country, 
  98. and (maybe) phone number) that were to be found in the input file.  Of course, 
  99. addresses in the USA, Canada, England, Germany, Italy, France and the like don't 
  100. really look very much alike (both in terms of data values, and how they are 
  101. typically formatted overall), but all needed to be recognized by the program 
  102. (and programs earned demerits if they recognized things as postal addresses that 
  103. clearly (to a human, at least) were not).
  104.  
  105. I designed and implemented (and posted) a program in SNOBOL4+ which met the 
  106. established criteria.  Needless to say, the other fellow never did.  :-)
  107.  
  108. >We have to gather some serious questions first, for example:
  109.  
  110. >How important for you are modern control structures? (If not at all, use
  111. Snobol4...)
  112.  
  113. So-called "modern" control structures are one paradigm for expressing 
  114. algorithms, but they are certainly not the only practical or effective one.  For 
  115. example, as the Icon book mentions, the statement
  116.  
  117.     (open(file) | write("Can't open the file!"))
  118.  
  119. is every bit as clear as (and more compact than) the more classical IF-THEN 
  120. statement.
  121.  
  122. Perhaps a more interesting real-world example is a piece of code which one finds 
  123. in more or less comparable form in nearly every one of my SNOBOL4+ programs.  
  124. The code is like the below:
  125.  
  126.    SCREEN = "Sorry, I cannot open the "
  127. +    (~INPUT(.INPUT,5,"R,300") "input text file, unit 5.",
  128. +     ~OUTPUT(.OUTPUT,6,"W,300") "output text file, unit 6.",
  129. +     ~OUTPUT(.LOG,8,"W,E,300","LOG.TXT") "output file LOG.TXT.")
  130. +                            :S(END)
  131.  
  132. Certainly this does not use the so-called "modern" IF-THEN control structure, 
  133. but if you try to implement the same functionality as I get using the above with 
  134. the "modern control structures" that you apparently find so wonderful in other 
  135. languages, I think you'll have a hard time showing how these so-called "modern" 
  136. control structures do a better job.
  137.  
  138. Of course, as in the case of McDonald's, some people really don't have the 
  139. imagination or intellectual drive to want to learn alternative ways of thinking 
  140. about problems.  For them, the clockwork-style "knit-one-perl-two" of classical 
  141. primitive control structures may better fit their personal and intellectual 
  142. style.    :-)
  143.  
  144. Gordon Peterson
  145. http://www.computek.net/public/gep2/
  146.  
  147.